The packages of integrated circuits are becoming increasing complex, with more device dies packaged in the same package to achieve more functions. For example, a package may include a plurality of device dies such as processors and memory cubes bonded to a same interposer. The interposer may be formed based on a semiconductor substrate, with through-silicon vias formed in the semiconductor substrate to interconnect the features formed on the opposite sides of the interposer. A molding compound encapsulates the device dies therein. The package including the interposer and the device dies are further bonded to a package substrate. In addition, surface mount devices may also be bonded to the substrate. A heat spreader may be attached to the top surfaces of the device dies in order to dissipate the heat generated in the device dies. The heat spreader may have a skirt portion fixed onto the package substrate.